<template>
<view>
<view>
    <view class="banner"></view>
    <view class="banner_modle">
        <view class="banner_modle_top">
            <image class="banner_modle_top_img" :src="detail.user.head_image?detail.user.head_image:memberInfo.avatar"></image>
            <view class="banner_modle_top_title">{{memberInfo.nickname}}
             
            </view>
            <view @tap="binding" class="banner_modle_top_btn">提现</view>
        </view>
        <view class="banner_modle_down">
            <navigator class="banner_modle_down_modle" url="/pages/mine/yongjinjilu/yongjinjilu">
                <view class="banner_modle_down_modle_top">{{total.brokerage}}</view>
                <view class="banner_modle_down_modle_down">总佣金</view>
            </navigator>
            <view class="banner_modle_down_border"></view>
            <navigator class="banner_modle_down_modle" url="/pages/mine/yongjinjilu/yongjinjilu">
                <view class="banner_modle_down_modle_top">{{total.withdraw}}</view>
                <view class="banner_modle_down_modle_down">已提现</view>
            </navigator>
            <view class="banner_modle_down_border"></view>
            <navigator class="banner_modle_down_modle" url="/pages/mine/tixian/tixian">
                <view class="banner_modle_down_modle_top">{{total.brokerage-total.withdraw}}</view>
                <view class="banner_modle_down_modle_down">可提现</view>
            </navigator>
            <view class="banner_modle_down_border"></view>
            <navigator class="banner_modle_down_modle" url="/pages/mine/fensi/fensi">
                <view class="banner_modle_down_modle_top">{{total.number}}</view>
                <view class="banner_modle_down_modle_down">推广人数</view>
            </navigator>
        </view>
    </view>
</view>
<navigator class="choose_view" style="margin-top:20rpx;" url="/pages/mine/yongjinjilu/yongjinjilu">
    <view class="choose_view_modle">
        <image class="choose_view_modle_img" src="/static/pages/image/yongjin.png"></image>佣金记录
        <image class="choose_view_modle_backImg" src="/static/pages/image/jiantou_btn.png"></image>
        <text class="choose_view_modle_num"></text>
    </view>
</navigator>
<navigator class="choose_view" url="/pages/mine/fensi/fensi">
    <view class="choose_view_modle">
        <image class="choose_view_modle_img" src="/static/pages/image/tuiguang.png"></image>推广记录
        <image class="choose_view_modle_backImg" src="/static/pages/image/jiantou_btn.png"></image>
        <text class="choose_view_modle_num"></text>
    </view>
</navigator>
<navigator class="choose_view" url="/pages/mine/tixianjilu/tixianjilu">
    <view class="choose_view_modle">
        <image class="choose_view_modle_img" src="/static/pages/image/tuiguang.png"></image>提现明细
        <image class="choose_view_modle_backImg" src="/static/pages/image/jiantou_btn.png"></image>
        <text class="choose_view_modle_num"></text>
    </view>
</navigator>
<view @tap="retopublicity" class="choose_view">
    <view class="choose_view_modle">
        <image class="choose_view_modle_img" src="/static/pages/image/fcode.png"></image>我的推广码
        <image class="choose_view_modle_backImg" src="/static/pages/image/jiantou_btn.png"></image>
    </view>
</view>
</view>
</template>

<script>
var app = getApp();

export default {
  data() {
    return {
      isShow: !1,
      total: {
        brokerage: 0,
        withdraw: 0,
        number: 0
      },
      memberInfo: "",
      detail: "",
      is_member: "",
      store_img: ""
    };
  },

  components: {},
  props: {},
  onLoad: function (a) {},
  onShow: function () {
    var t = this;
    app.globalData.util.getUserInfo(function (a) {
      a.memberInfo && (t.setData({
        memberInfo: a.memberInfo
      }), wx.setStorageSync("uid", a.memberInfo.uid), t.firstin(a.memberInfo));
    });
  },
  onReachBottom: function () {},
  methods: {
    firstin: function (a) {
      var t = this;
      app.globalData.util.request({
        url: "entry/wxapp/Api",
        data: {
          m: "monai_market",
          r: "me.detail",
          uid: a.uid,
          head_image: a.avatar,
          nickname: a.nickname
        },
        success: function (a) {
          t.setData({
            detail: a.data.data,
            is_member: a.data.data.user.is_member,
            store_img: a.data.data.user.store_img
          });
        }
      }), app.globalData.util.request({
        url: "entry/wxapp/Api",
        data: {
          m: "monai_market",
          r: "store.getSaleinfo",
          uid: a.uid
        },
        success: function (a) {
          t.setData({
            total: a.data.data
          });
        }
      });
    },
    retopublicity: function () {
      wx.navigateTo({
        url: "/pages/mine/publicity/index"
      });
    },
    binding: function () {
      wx.navigateTo({
        url: "/pages/mine/tixian/tixian"
      });
    },
    retocollection: function () {
      wx.navigateTo({
        url: "/pagesA/space/index"
      });
    }
  }
};
</script>
<style>
@import "./index.css";
</style>